import { callNative } from './util'

export const createSocket = () => {
  const host = window.location.hostname
  const port = 8087
  const client = new window.WebSocket('ws://' + host + ':' + port + '/')

  client.onmessage = function (e) {
    if (e.data === 'refresh') {
      callNative.command('refresh')
    }
  }
}
